package com.lagou.hot.init;

import com.lagou.hot.cache.GuavaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * @Author: Hugh
 * @Date: 2020/10/10
 */
@Component
public class GuavaInit implements ApplicationListener<ContextRefreshedEvent> {

    @Autowired
    private GuavaService gservice;

    @lombok.SneakyThrows
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        gservice.init();
    }
}
